package com.tentact.servlets;

import com.tentact.service.MeetingService;
import com.tentact.vo.MeetingRoom;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "SelectMeetingRoomsServlet", value = "/SelectMeetingRoomsServlet")
public class SelectMeetingRoomsServlet extends HttpServlet {
    private MeetingService service = new MeetingService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String roomname = request.getParameter("roomname");
        List<MeetingRoom> list = service.selectByroomname();
        request.setAttribute("list",list);
        request.getRequestDispatcher("meetingrooms.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }
}
